package com.aimei.worker.moduel.controller;

import com.aimei.worker.moduel.entity.Teacher;
import com.aimei.worker.moduel.feign.UserFeignServer;
import com.aimei.worker.moduel.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/api/worker")
public class TeacherController {

       @Autowired
       private TeacherService teacherService;

       @Autowired
       private UserFeignServer userFeignServer;
       @RequestMapping("/getTeacher")
       @ResponseBody
       public Teacher getTeacher(){
              return teacherService.getTeacher();
       }

       @RequestMapping("/getUserName")
       @ResponseBody
       public String getUserName(){
              return userFeignServer.getUserName();
       }
}
